﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ShredTheLog.Api.DataContracts;
using System.Windows.Input;
using System.Diagnostics.Contracts;

namespace ShredTheLog.Api
{
    [ContractClass(typeof(ShredSettings_Contract))]
    public interface IShredSettings : IAssignable
    {
        ISettingsSection[] Sections { get; }
    }

    [ContractClassFor(typeof(IShredSettings))]
    internal abstract class ShredSettings_Contract : IShredSettings
    {
        ISettingsSection[] IShredSettings.Sections
        {
            get 
            {
                Contract.Ensures(Contract.Result<ISettingsSection[]>() != null);
                throw new NotImplementedException(); 
            }
        }

        void IAssignable.Assign(object obj)
        {
            throw new NotImplementedException();
        }
    }

    [ContractClass(typeof(Assignable_Contract))]
    public interface IAssignable
    {
        void Assign(object obj);
    }

    [ContractClassFor(typeof(IAssignable))]
    internal abstract class Assignable_Contract : IAssignable
    {
        void IAssignable.Assign(object obj)
        {
            Contract.Requires(obj != null);
            throw new NotImplementedException();
        }
    }

    public interface ISettingsSection : IAssignable
    {
    }

    public interface ISettingsPageViewModel
    {
        string Header { get; }
        void Save();
    }

    [ContractClass(typeof(UiSettingsSection_Contract))]
    public interface IUiSettingsSection : ISettingsSection
    {
        string ThemeID { get; set; }
        ITheme GetTheme();
        Language UiLanguage { get; set; }
        IUiLanguage GetUiLanguage();
        KeyGesture SendMessageGesture { get; set; }
        bool SendTypingNotifications { get; set; }
        bool ShowMessageTime { get; set; }
    }

    [ContractClassFor(typeof(IUiSettingsSection))]
    internal abstract class UiSettingsSection_Contract : IUiSettingsSection
    {
        string IUiSettingsSection.ThemeID
        {
            get
            {
                Contract.Ensures(!String.IsNullOrWhiteSpace(Contract.Result<string>()));
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        ITheme IUiSettingsSection.GetTheme()
        {
            Contract.Ensures(Contract.Result<ITheme>() != null);
            throw new NotImplementedException();
        }

        Language IUiSettingsSection.UiLanguage
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        IUiLanguage IUiSettingsSection.GetUiLanguage()
        {
            Contract.Ensures(Contract.Result<IUiLanguage>() != null);
            throw new NotImplementedException();
        }

        KeyGesture IUiSettingsSection.SendMessageGesture
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        bool IUiSettingsSection.SendTypingNotifications
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        bool IUiSettingsSection.ShowMessageTime
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        void IAssignable.Assign(object obj)
        {
            throw new NotImplementedException();
        }
    }

    [ContractClass(typeof(ConnectionSettingsSection_Contract))]
    public interface IConnectionSettingsSection : ISettingsSection
    {
        bool UseDefaultConnectionSettings { get; set; }
        string BaseServer { get; set; }
        string TextChatServer { get; set; }
        string UserName { get; set; }
        string Password { get; set; }
        IShredClient GetClient();
    }

    [ContractClassFor(typeof(IConnectionSettingsSection))]
    internal abstract class ConnectionSettingsSection_Contract : IConnectionSettingsSection
    {
        bool IConnectionSettingsSection.UseDefaultConnectionSettings
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        string IConnectionSettingsSection.BaseServer
        {
            get
            {
                Contract.Ensures(!String.IsNullOrWhiteSpace(Contract.Result<string>()));
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        string IConnectionSettingsSection.TextChatServer
        {
            get
            {
                Contract.Ensures(!String.IsNullOrWhiteSpace(Contract.Result<string>()));
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        string IConnectionSettingsSection.UserName
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        string IConnectionSettingsSection.Password
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        IShredClient IConnectionSettingsSection.GetClient()
        {
            Contract.Ensures(Contract.Result<IShredClient>() != null);
            throw new NotImplementedException();
        }

        void IAssignable.Assign(object obj)
        {
            throw new NotImplementedException();
        }
    }

    [ContractClass(typeof(TranslatorSettingsSection_Contract))]
    public interface ITranslatorSettingsSection : ISettingsSection
    {
        bool IsActive { get; set; }
        string TranslatorID { get; set; }
        ITranslatorBase GetTranslator();
        ITranslatorBase GetFilteringTranslator();
        bool IsUiLanguageTarget { get; set; }
        Language TargetLanguage { get; set; }
        Language GetTargetLanguage();
    }

    [ContractClassFor(typeof(ITranslatorSettingsSection))]
    internal abstract class TranslatorSettingsSection_Contract : ITranslatorSettingsSection
    {
        bool ITranslatorSettingsSection.IsActive
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        string ITranslatorSettingsSection.TranslatorID
        {
            get
            {
                Contract.Ensures(!String.IsNullOrWhiteSpace(Contract.Result<string>()));
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        ITranslatorBase ITranslatorSettingsSection.GetTranslator()
        {
            Contract.Ensures(Contract.Result<ITranslatorBase>() != null);
            throw new NotImplementedException();
        }

        ITranslatorBase ITranslatorSettingsSection.GetFilteringTranslator()
        {
            Contract.Ensures(Contract.Result<ITranslatorBase>() != null);
            throw new NotImplementedException();
        }

        bool ITranslatorSettingsSection.IsUiLanguageTarget
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        Language ITranslatorSettingsSection.TargetLanguage
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        Language ITranslatorSettingsSection.GetTargetLanguage()
        {
            throw new NotImplementedException();
        }

        void IAssignable.Assign(object obj)
        {
            throw new NotImplementedException();
        }
    }

    public interface INotificationSettingsSection : ISettingsSection
    {
        INotifierSettings[] Settings { get; }
    }

    public interface INotifierSettings : IAssignable, ICloneable
    {
        bool IsActive { get; set; }
        bool NotifyOnMessagesInActiveChatWindows { get; set; }
        bool NotifyOnPublicChatMessages { get; set; }
    }

    public interface ISoundNotifierSettings : INotifierSettings
    {
    }

    public interface IFlashWindowNotifierSettings : INotifierSettings
    {
    }

    public interface IBalloonTipNotifierSettings : INotifierSettings
    {
    }
}
